//
//  ZNavigationController.m
//  ZPlayer
//
//  Created by Zed Link on 26/11/2016.
//  Copyright © 2016 ZED. All rights reserved.
//

#import "ZNavigationController.h"

@interface ZNavigationController ()

@end

@implementation ZNavigationController

+ (void)load {

    // 统一设置导航条字体颜色
    [[UINavigationBar appearance] setTintColor:FONT_SECOND_COLOR];
    [[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]];

    [[UINavigationBar appearance] setTranslucent:NO];
    // 设置背景颜色
    // 去除那条线
    //    [UINavigationBar appearance] setBackgroundImage:<#(nullable UIImage *)#> forBarMetrics:<#(UIBarMetrics)#>

    [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:FONT_THIRD_COLOR}];

}

- (UIViewController *)childViewControllerForStatusBarStyle
{
    return self.topViewController;
}

-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.childViewControllers.count==1) {
        viewController.hidesBottomBarWhenPushed = YES; //viewController是将要被push的控制器
    }
    [super pushViewController:viewController animated:animated];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    [segue.destinationViewController setHidesBottomBarWhenPushed:YES];
}

@end
